1 <?php include ( "inc/connect.inc.php" ); ?>
2 <?php
3 ob_start();
4 session_start();

5 if
(!isset($_SESSION['user_login'])) {
6     $user =
"";
7 }

8 else
{
9     $user = $_SESSION[
'user_login'];
10     $result = mysql_query(
"SELECT * FROM user WHERE id='$user'");
11         $get_user_email = mysql_fetch_assoc($result);
12             $uname_db = $get_user_email[
'firstName'];
13 }

14
15 if
(isset($_REQUEST['keywords'])) {
16
17     $epid = mysql_real_escape_string($_REQUEST[
'keywords']);
18     
if($epid != "" && ctype_alnum($epid)){
19         
20     }
else {
21         header(
'location: index.php');
22     }
23 }
else {
24     header(
'location: index.php');
25 }
26
27 $search_value =
"";
28 $search_value = trim($_GET[
'keywords']);
29
30 ?>
31
32 <!DOCTYPE html>
33 <html>
34 <head>
35     <title>SAREE</title>
36     <link rel=
"stylesheet" type="text/css" href="css/style.css">
37     <meta name=
"viewport" content="width=device-width, initial-scale=1">
38 </head>
39 <body>
40     <div
class="homepageheader">
41         <div
class="signinButton loginButton">
42             <div
class="uiloginbutton signinButton loginButton" style="margin-right: 40px;">
43                 <?php
44                     
if ($user!="") {
45                         echo
'<a style="text-decoration: none; color: #fff;" href="logout.php">LOG OUT</a>';
46                     }
47                     
else {
48                         echo
'<a style="text-decoration: none; color: #fff;" href="signin.php">SIGN IN</a>';
49                     }
50                  ?>
51                 
52             </div>
53             <div
class="uiloginbutton signinButton loginButton" style="">
54                 <?php
55                     
if ($user!="") {
56                         echo
'<a style="text-decoration: none; color: #fff;" href="profile.php?uid='.$user.'">Hi '.$uname_db.'</a>';
57                     }
58                     
else {
59                         echo
'<a style="text-decoration: none; color: #fff;" href="login.php">LOG IN</a>';
60                     }
61                  ?>
62             </div>
63         </div>
64         <div style=
"float: left; margin: 5px 0px 0px 23px;">
65             <a href=
"index.php">
66                 <img style=
" height: 75px; width: 130px;" src="image/ebuybdlogo.png">
67             </a>
68         </div>
69         <div id=
"srcheader">
70                 <form id=
"newsearch" method="get" action="search.php">
71                         <?php
72                             echo
'<input type="text" class="srctextinput" name="keywords" size="21" maxlength="120" placeholder="Search Here..." value="'.$search_value.'"><input type="submit" value="search" class="srcbutton" >';
73                          ?>
74                 </form>
75             <div
class="srcclear"></div>
76         </div>
77     </div>
78     <div
class="categolis">
79         <table>
80             <tr>
81                 <th>
82                     <a href=
"women/saree.php" style="text-decoration: none;color: #ddd;padding: 4px 12px;background-color: #c7587e;border-radius: 12px;">Saree</a>
83                 </th>
84                 <th><a href=
"women/ornament.php" style="text-decoration: none;color: #ddd;padding: 4px 12px;background-color: #c7587e;border-radius: 12px;">Ornament</a></th>
85                 <th><a href=
"women/watch.php" style="text-decoration: none;color: #ddd;padding: 4px 12px;background-color: #c7587e;border-radius: 12px;">Watch</a></th>
86                 <th><a href=
"women/perfume.php" style="text-decoration: none;color: #ddd;padding: 4px 12px;background-color: #c7587e;border-radius: 12px;">Perfume</a></th>
87                 <th><a href=
"women/hijab.php" style="text-decoration: none;color: #ddd;padding: 4px 12px;background-color: #c7587e;border-radius: 12px;">Hijab</a></th>
88                 <th><a href=
"women/tshirt.php" style="text-decoration: none;color: #ddd;padding: 4px 12px;background-color: #c7587e;border-radius: 12px;">T-Shirt</a></th>
89                 <th><a href=
"women/footwear.php" style="text-decoration: none;color: #ddd;padding: 4px 12px;background-color: #c7587e;border-radius: 12px;">FootWear</a></th>
90                 <th><a href=
"women/toilatry.php" style="text-decoration: none;color: #ddd;padding: 4px 12px;background-color: #c7587e;border-radius: 12px;">Toilatry</a></th>
91             </tr>
92         </table>
93     </div>
94     <div style=
"padding: 30px 120px; font-size: 25px; margin: 0 auto; display: table; width: 98%;">
95         <div>
96         <?php
97             
if (isset($_GET['keywords']) && $_GET['keywords'] != ""){
98                 $search_value = trim($_GET[
'keywords']);
99                 $getposts = mysql_query(
"SELECT * FROM products WHERE pName like '%$search_value%' ORDER BY id DESC") or die(mysql_error());
100                     
if ( $total = mysql_num_rows($getposts)) {
101                     echo
'<ul id="recs">';
102                     echo
'<div style="text-align: center;"> '.$total.' Products Found... </div><br>';
103                     
while ($row = mysql_fetch_assoc($getposts)) {
104                         $id = $row[
'id'];
105                         $pName = $row[
'pName'];
106                         $price = $row[
'price'];
107                         $description = $row[
'description'];
108                         $picture = $row[
'picture'];
109                         $item = $row[
'item'];
110                         
111                         echo
'
112                             <ul style=
"float: left;">
113                                 <li style=
"float: left; padding: 0px 25px 25px 25px;">
114                                     <div
class="home-prodlist-img"><a href="women/view_product.php?pid='.$id.'">
115                                         <img src=
"image/product/'.$item.'/'.$picture.'" class="home-prodlist-imgi">
116                                         </a>
117                                         <div style=
"text-align: center; padding: 0 0 6px 0;"> <span style="font-size: 15px;">'.$pName.'</span><br> Price: '.$price.' Tk</div>
118                                     </div>
119                                     
120                                 </li>
121                             </ul>
122                         
';
123
124                         }
125                 }
else {
126                 echo
"Nothing Found!";
127             }
128             }
else {
129                 echo
"Input Someting...";
130             }
131             
132         ?>
133             
134         </div>
135     </div>
136 </body>
137 </html>


Gõ tìm kiếm nhanh...